import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'

export default defineConfig({
  plugins: [react(),tailwindcss()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData:`
        @use "/src/style/setting/vars" as *;
        @use "/src/style/tools/mixin/_flex" as *;
        `,
      }
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'https://m1.apifoxmock.com/m1/6208993-5902384-default',
        changeOrigin: true,
        // rewrite: (path) => path.replace(/^\/api/, ''),
      },
    },
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src")
    },
  },
})
